from flask import Flask
from models import db
from flask_cors import CORS
from views.admin import admin_bp

def my_app(cert):

    flask_app = Flask(__name__)

    flask_app.config.from_object(cert)

    # 注册蓝图
    flask_app.register_blueprint(admin_bp)

    # 注册模型类
    db.init_app(flask_app)

    # 注册跨域
    dada = CORS(flask_app)
    return flask_app






